<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>留守儿童信息管理系统</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="/css/style.min.css" rel="stylesheet">
</head>

<body>

<div class="lyear-layout-web">

    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">
            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <a th:href="@{/index}"><img src="/images/logo-sidebar.png" title="LightYear" alt="LightYear"/></a>
            </div>
            <div class="lyear-layout-sidebar-scroll" >
                <nav class="sidebar-main">
                    <ul class="nav nav-drawer">
                        <li class="nav-item active"><a th:href="@{/index}"><i class="mdi mdi-home"></i>后台首页</a></li>
                        <li class="nav-item nav-item-has-subnav" id="admin">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 办公室主任</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/adminList}">办公室主任列表</a></li>

                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="children">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 留守儿童管理</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/childrenList}">留守儿童列表</a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="veteran">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 退伍军人管理</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/veteranList}">退伍军人列表</a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="elderly">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 独居老人管理</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/elderlyList}">独居老人列表</a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="gift">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 礼品管理</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/giftList}">礼品列表</a></li>
                                <li><a th:href="@{/giftMoney}">礼品金额列表</a></li>

                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="childrenGift">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 礼品管理</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/childrenGiftList}">礼品列表</a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="elderlyGift">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 礼品管理</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/elderlyGiftList}">礼品列表</a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="veteranGift">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 礼品管理</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/veteranGiftList}">礼品列表</a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="community">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 社区工作人员管理</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/communityList}">社区工作人员列表</a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="examine">
                            <a href="javascript:void(0)"><i class="mdi mdi-email"></i> 审核管理</a>
                            <ul class="nav nav-subnav">
                                <li id="examineStatus"><a th:href="@{/regExamine}">注册审核 <span class="badge" th:text="${session.examineStatusSize}" id="examineStatusSize"></span></a></li>
                                <li id="cancellation"><a th:href="@{/cancelExamine/{userName}/(userName=${session.username})}">账号注销审核 <span class="badge" id="cancellationSize" th:text="${session.cancellationSize}"></span></a></li>
                                <li id="delChildren"><a th:href="@{/delChildrenExamine}">删除儿童信息审核 <span class="badge" th:text="${session.DelChildrenSize}" id="DelChildrenSize"></span></a></li>
                                <li id="delVeteran"><a th:href="@{/delVeteranExamine}">删除退伍军人信息审核 <span class="badge" th:text="${session.DelVeteranSize}" id="DelVeteranSize"></span></a></li>
                                <li id="delElderly"><a th:href="@{/delElderlyExamine}">删除独居老人信息审核 <span class="badge" th:text="${session.DelElderlySize}" id="DelElderlySize"></span></a></li>
                                <li id="giftExamine"><a th:href="@{/giftExamine}">礼品信息审核 <span class="badge" th:text="${session.GiftSize}" id="GiftSize"></span></a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav" id="information">
                            <a href="javascript:void(0)"><i class="mdi mdi-message-draw"></i> 信息反馈</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/feedBack}">信息反馈</a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav"  id="system">
                            <a href="javascript:void(0)"><i class="mdi mdi-settings"></i> 系统维护</a>
                            <ul class="nav nav-subnav">
                                <li><a th:href="@{/notice}">系统公告</a></li>
                                <li><a th:href="@{/feedBackManage}">信息反馈管理</a></li>
                            </ul>
                        </li>
                    </ul>
                </nav>

                <!--<div class="sidebar-footer">
                  <p class="copyright">Copyright &copy; 2019. All rights reserved. More Templates 更多模板：<a href="http://www.mycodes.net/" target="_blank">模板之家</a></p>
                </div>-->
            </div>

        </aside>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">

            <nav class="navbar navbar-default">
                <div class="topbar">

                    <div class="topbar-left">
                        <div class="lyear-aside-toggler">
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                        </div>
                        <span class="navbar-page-title"> 后台首页 </span>
                    </div>

                    <ul th:replace="~{commons::topbar-right}"></ul>

                </div>
            </nav>

        </header>

        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-6 col-lg-3" id="childrenNum">
                        <div class="card bg-primary">
                            <div class="card-body clearfix">
                                <div class="pull-right">
                                    <p class="h6 text-white m-t-0">留守儿童数量</p>
                                    <a class="h3 text-white m-b-0" th:href="@{/childrenList}" th:text="${ChildrenNum}"></a>
                                </div>
                                <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i
                                        class="mdi mdi-human-child fa-1-5x"></i></span></div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row" id="veteranNum">
                    <div class="col-sm-6 col-lg-3">
                        <div class="card bg-primary">
                            <div class="card-body clearfix">
                                <div class="pull-right">
                                    <p class="h6 text-white m-t-0">退伍军人数量</p>
                                    <a class="h3 text-white m-b-0" th:href="@{/veteranList}" th:text="${VeteranNum}"></a>
                                </div>
                                <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i
                                        class="mdi mdi-human-child fa-1-5x"></i></span></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row" id="elderlyNum">
                    <div class="col-sm-6 col-lg-3">
                        <div class="card bg-primary">
                            <div class="card-body clearfix">
                                <div class="pull-right">
                                    <p class="h6 text-white m-t-0">独居老人数量</p>
                                    <a class="h3 text-white m-b-0" th:href="@{/elderlyList}" th:text="${ElderlyNum}"></a>
                                </div>
                                <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i
                                        class="mdi mdi-human-child fa-1-5x"></i></span></div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row" id="giftsNum">
                    <div class="col-sm-6 col-lg-3">
                        <div class="card bg-primary">
                            <div class="card-body clearfix">
                                <div class="pull-right">
                                    <p class="h6 text-white m-t-0">礼品信息数量</p>
                                    <a class="h3 text-white m-b-0" th:href="@{/giftList}" th:text="${GiftsNum}"></a>
                                </div>
                                <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i
                                        class="mdi mdi-human-child fa-1-5x"></i></span></div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-sm-6 col-lg-3" id="communityTotal">
                    <div class="card bg-danger">
                        <div class="card-body clearfix">
                            <div class="pull-right">
                                <p class="h6 text-white m-t-0">工作人员总数</p>
                                <a class="h3 text-white m-b-0" th:href="@{/communityList}" th:text="${CommunityNum}"></a>
                            </div>
                            <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i
                                    class="mdi mdi-account fa-1-5x"></i></span></div>
                        </div>
                    </div>
                </div>

                <div class="col-sm-6 col-lg-3" id="adminTotal">
                    <div class="card bg-success">
                        <div class="card-body clearfix">
                            <div class="pull-right">
                                <p class="h6 text-white m-t-0">管理人员总数</p>
                                <a class="h3 text-white m-b-0" th:href="@{/adminList}" th:text="${ManagerNum}"></a>
                            </div>
                            <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i
                                    class="mdi mdi-account fa-1-5x"></i></span></div>
                        </div>
                    </div>
                </div>

                <div class="row">

                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <h4>公告</h4>
                            </div>
                            <div class="card-body" >
                                <div class="table-responsive">
                                    <b><p align="center" style="font-size: 16px" th:text="${theme}"></p></b>
                                    <p style="text-indent: 2em; font-size: 17px"  th:text="${content}"></p>

                                </div>
                            </div>
                        </div>
                    </div>

                </div>


            </div>





<!--                    <div class="col-sm-6 col-lg-3" id="feedBackTotal">-->
<!--                        <div class="card bg-purple">-->
<!--                            <div class="card-body clearfix">-->
<!--                                <div class="pull-right">-->
<!--                                    <p class="h6 text-white m-t-0">新增留言总数</p>-->
<!--                                    <p class="h3 text-white m-b-0">153 条</p>-->
<!--                                </div>-->
<!--                                <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i-->
<!--                                        class="mdi mdi-comment-outline fa-1-5x"></i></span></div>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->

                <!--<div class="row">

                    <div class="col-lg-6">
                        <div class="card">
                            <div class="card-header">
                                <h4>每周用户</h4>
                            </div>
                            <div class="card-body">
                                <p>每周用户</p>
                            </div>
                        </div>
                    </div>

                    <div class="col-lg-6">
                        <div class="card">
                            <div class="card-header">
                                <h4>交易历史记录</h4>
                            </div>
                            <div class="card-body">
                                <canvas class="js-chartjs-lines"></canvas>
                            </div>
                        </div>
                    </div>

                </div>-->



            <p th:text="${session.role}" id="p1" hidden></p>
</main>
        <!--End 页面主要内容-->
    </div>
</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>

<!--图表插件-->
<script type="text/javascript" src="js/Chart.js"></script>
<script type="text/javascript">
    var examineStatusSize = $("#examineStatusSize").text();
    if (examineStatusSize == 0){
        document.getElementById("examineStatusSize").style.display = "none";
    }
    var DelChildrenSize = $("#DelChildrenSize").text();
    if (DelChildrenSize == 0){
        document.getElementById("DelChildrenSize").style.display = "none";
    }
    var DelElderlySize = $("#DelElderlySize").text();
    if (DelElderlySize == 0){
        document.getElementById("DelElderlySize").style.display = "none";
    }
    var DelVeteranSize = $("#DelVeteranSize").text();
    if (DelVeteranSize == 0){
        document.getElementById("DelVeteranSize").style.display = "none";
    }
    var GiftSize = $("#GiftSize").text();
    if (GiftSize == 0){
        document.getElementById("GiftSize").style.display = "none";
    }
    var cancellationSize = $("#cancellationSize").text();
    if (cancellationSize == 0){
        document.getElementById("cancellationSize").style.display = "none";
    }

    var examineStatusSize = $("#examineStatusSize").text();
    if (examineStatusSize == 0){
        document.getElementById("examineStatusSize").style.display = "none";
    }
    var DelChildrenSize = $("#DelChildrenSize").text();
    if (DelChildrenSize == 0){
        document.getElementById("DelChildrenSize").style.display = "none";
    }
    var DelVeteranSize = $("#DelVeteranSize").text();
    if (DelVeteranSize == 0){
        document.getElementById("DelVeteranSize").style.display = "none";
    }

    var role = $("#p1").text();
    console.log(role)
    if (role == "0"){
        var admin = document.getElementById("admin");
        admin.style.display="none";
        document.getElementById("adminTotal").style.display="none";
        document.getElementById("childrenGift").style.display="none";
        document.getElementById("elderlyGift").style.display="none";
        document.getElementById("veteranGift").style.display="none";
        document.getElementById("delVeteran").style.display="none";
        document.getElementById("delChildren").style.display="none";
        document.getElementById("delElderly").style.display="none";

    }
    if (role == "1"){
        document.getElementById("admin").style.display="none";
        document.getElementById("community").style.display="none";
        document.getElementById("examine").style.display="none";
        document.getElementById("system").style.display="none";
        document.getElementById("adminTotal").style.display="none";
        document.getElementById("communityTotal").style.display="none";
        document.getElementById("elderly").style.display="none";
        document.getElementById("veteran").style.display="none";
        document.getElementById("veteranNum").style.display="none";
        document.getElementById("elderlyNum").style.display="none";
        document.getElementById("giftExamine").style.display="none";
        document.getElementById("gift").style.display="none";
        document.getElementById("elderlyGift").style.display="none";
        document.getElementById("giftsNum").style.display="none";
        document.getElementById("veteranGift").style.display="none";

    }
    if(role == "2"){
        document.getElementById("elderlyGift").style.display="none";
        document.getElementById("childrenGift").style.display="none";
        document.getElementById("veteranGift").style.display="none";
        document.getElementById("delChildren").style.display="none";
        document.getElementById("delVeteran").style.display="none";
        document.getElementById("delElderly").style.display="none";


    }
    if (role == "3"){

        document.getElementById("admin").style.display="none";
        document.getElementById("community").style.display="none";
        document.getElementById("examineStatus").style.display="none";
        document.getElementById("delElderly").style.display="none";
        document.getElementById("delVeteran").style.display="none";
        document.getElementById("giftExamine").style.display="none";
        document.getElementById("system").style.display="none";
        document.getElementById("adminTotal").style.display="none";
        document.getElementById("communityTotal").style.display="none";
        document.getElementById("elderly").style.display="none";
        document.getElementById("veteran").style.display="none";
        document.getElementById("veteranNum").style.display="none";
        document.getElementById("elderlyNum").style.display="none";
        document.getElementById("giftExamine").style.display="none";
        document.getElementById("cancellation").style.display="none";
        document.getElementById("gift").style.display="none";
        document.getElementById("elderlyGift").style.display="none";
        document.getElementById("giftsNum").style.display="none";
        document.getElementById("veteranGift").style.display="none";


    }
    if (role == "4"){

        document.getElementById("admin").style.display="none";
        document.getElementById("children").style.display="none";
        document.getElementById("elderly").style.display="none";
        document.getElementById("community").style.display="none";
        document.getElementById("examine").style.display="none";
        document.getElementById("system").style.display="none";
        document.getElementById("adminTotal").style.display="none";
        document.getElementById("communityTotal").style.display="none";
        document.getElementById("childrenNum").style.display="none";
        document.getElementById("elderlyNum").style.display="none";
        document.getElementById("giftExamine").style.display="none";
        document.getElementById("childrenGift").style.display="none";
        document.getElementById("elderlyGift").style.display="none";
        document.getElementById("gift").style.display="none";
        document.getElementById("giftsNum").style.display="none";



    }
    if (role == "5"){

        document.getElementById("admin").style.display="none";
        document.getElementById("children").style.display="none";
        document.getElementById("elderly").style.display="none";
        document.getElementById("community").style.display="none";
        document.getElementById("examineStatus").style.display="none";
        document.getElementById("delElderly").style.display="none";
        document.getElementById("delChildren").style.display="none";
        document.getElementById("cancellation").style.display="none";
        document.getElementById("system").style.display="none";
        document.getElementById("adminTotal").style.display="none";
        document.getElementById("communityTotal").style.display="none";
        document.getElementById("childrenNum").style.display="none";
        document.getElementById("elderlyNum").style.display="none";
        document.getElementById("giftExamine").style.display="none";
        document.getElementById("childrenGift").style.display="none";
        document.getElementById("elderlyGift").style.display="none";
        document.getElementById("gift").style.display="none";
        document.getElementById("giftsNum").style.display="none";

    }
    if (role == "6"){

        document.getElementById("admin").style.display="none";
        document.getElementById("children").style.display="none";
        document.getElementById("veteran").style.display="none";
        document.getElementById("community").style.display="none";
        document.getElementById("examine").style.display="none";
        document.getElementById("system").style.display="none";
        document.getElementById("adminTotal").style.display="none";
        document.getElementById("communityTotal").style.display="none";
        document.getElementById("childrenNum").style.display="none";
        document.getElementById("veteranNum").style.display="none";
        document.getElementById("giftExamine").style.display="none";
        document.getElementById("childrenGift").style.display="none";
        document.getElementById("gift").style.display="none";
        document.getElementById("giftsNum").style.display="none";
        document.getElementById("veteranGift").style.display="none";


    }
    if (role == "7"){

        document.getElementById("admin").style.display="none";
        document.getElementById("children").style.display="none";
        document.getElementById("veteran").style.display="none";
        document.getElementById("community").style.display="none";
        document.getElementById("examineStatus").style.display="none";
        document.getElementById("delVeteran").style.display="none";
        document.getElementById("delChildren").style.display="none";
        document.getElementById("cancellation").style.display="none";
        document.getElementById("system").style.display="none";
        document.getElementById("adminTotal").style.display="none";
        document.getElementById("communityTotal").style.display="none";
        document.getElementById("childrenNum").style.display="none";
        document.getElementById("veteranNum").style.display="none";
        document.getElementById("giftExamine").style.display="none";
        document.getElementById("giftsNum").style.display="none";
        document.getElementById("childrenGift").style.display="none";
        document.getElementById("gift").style.display="none";
        document.getElementById("veteranGift").style.display="none";
        document.getElementById("giftsNum").style.display="none";


    }

</script>
</body>
</html>